double height)
{
GtkRenderNodePaintable *self = GTK_RENDER_NODE_PAINTABLE (paintable);
- gboolean needs_transform;
if (self->bounds.size.width <= 0 ||
self->bounds.size.height <= 0)
return;
- needs_transform = self->bounds.size.width != width ||
- self->bounds.size.height != height;
+ gtk_snapshot_save (snapshot);
- if (needs_transform)
- {
- graphene_matrix_t transform;
-
- graphene_matrix_init_scale (&transform,
- width / (self->bounds.size.width),
- height / (self->bounds.size.height),
- 1.0);
- gtk_snapshot_push_transform (snapshot,
- &transform);
- }
-
- gtk_snapshot_offset (snapshot, -self->bounds.origin.x, -self->bounds.origin.y);
+ gtk_snapshot_scale (snapshot,
+ width / (self->bounds.size.width),
+ height / (self->bounds.size.height));
+ gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (-self->bounds.origin.x, -self->bounds.origin.y));
gtk_snapshot_push_clip (snapshot, &self->bounds);
gtk_snapshot_pop (snapshot);
- gtk_snapshot_offset (snapshot, self->bounds.origin.x, self->bounds.origin.y);
-
- if (needs_transform)
- gtk_snapshot_pop (snapshot);
+ gtk_snapshot_restore (snapshot);
}
static GdkPaintableFlags